package io.gitee.thinkbungee.constant;

/**
 * @author chenyichang
 * @date 2022/2/18
 */
public interface SatelliteConstant {
    /**
     * 升序
     */
    String ASC = "ASC";

    /**
     * 降序
     */
    String DESC = "DESC";

    /**
     * 系统分隔符
     */
    String SPLIT = ",";

    /**
     * id
     */
    String ID = "id";


    class Mongo {

        private String id;

        public String getId() {
            return id;
        }
    }

    /**
     * 异常
     */
    enum Exception {
        /**
         * 插入失败
         */
        INSERT_FAILURE("000001", "insert.failure"),
        /**
         * 更新失败
         */
        UPDATE_FAILURE("000002", "insert.failure"),
        /**
         * 记录不存在
         */
        RECORD_NOT_EXIST("000003", "insert.failure"),
        /**
         * 删除失败
         */
        DELETE_FAILURE("000004", "delete.failure")
        ;

        private final String code;
        private final String arg;

        Exception(String code, String arg) {
            this.code = code;
            this.arg = arg;
        }

        public String getCode() {
            return code;
        }

        public String getArg() {
            return arg;
        }
    }

    /**
     * 响应码
     */
    interface HttpCode {
        /**
         * 成功响应码
         */
        String SUCCESS_CODE = "0";
        /**
         * 失败响应码
         */
        String FAIL_CODE = "-1";
    }

    /**
     * satellite组件相关
     */
    interface Component {

        /**
         * 组件前缀
         */
        String PREFIX = "spring.satellite.component.";

        /**
         * 是否启用
         */
        String ENABLE = ".enable";

        //==========具体组件============//

        //=======推送组件==========//
        /**
         * 推送组件中的邮件服务
         */
        String MAIL = "mail";
    }
}
